<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DM-CtrlH7-BF-DevProgram: C:/Users/ASUS/Desktop/dm-ctrlH7-balance-9025test/bsp/dwt/bsp_dwt.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="50x5.png"/></td>
  <td id="projectalign">
   <div id="projectname">DM-CtrlH7-BF-DevProgram<span id="projectnumber">&#160;beta 0.1</span>
   </div>
   <div id="projectbrief">C.ONE Studio Damiao Development Board Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('bsp__dwt_8h_source.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">bsp_dwt.h</div></div>
</div><!--header-->
<div class="contents">
<a href="bsp__dwt_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#ifndef _BSP_DWT_H</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#define _BSP_DWT_H</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#include &quot;<a class="code" href="main_8h.html">main.h</a>&quot;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#include &quot;stdint.h&quot;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#include &quot;bsp_log.h&quot;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span> </div>
<div class="foldopen" id="foldopen00021" data-start="{" data-end="};">
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="struct_d_w_t___time__t.html">   21</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>{</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>    uint32_t s;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    uint16_t ms;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    uint16_t us;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>} <a class="code hl_struct" href="struct_d_w_t___time__t.html">DWT_Time_t</a>;</div>
</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span></div>
<div class="foldopen" id="foldopen00033" data-start="" data-end="">
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="bsp__dwt_8h.html#a9b46a15916bbafb8610eb121c36dce04">   33</a></span><span class="preprocessor">#define TIME_ELAPSE(dt, code)                    \</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="preprocessor">    do                                           \</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="preprocessor">    {                                            \</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="preprocessor">        float tstart = DWT_GetTimeline_s();      \</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="preprocessor">        code;                                    \</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="preprocessor">        dt = DWT_GetTimeline_s() - tstart;       \</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">        LOGINFO(&quot;[DWT] &quot; #dt &quot; = %f s\r\n&quot;, dt); \</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="preprocessor">    } while (0)</span></div>
</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="keywordtype">void</span> <a class="code hl_function" href="bsp__dwt_8h.html#a80bda377ca5cef73b03e7211b1fa18b9">DWT_Init</a>(uint32_t CPU_Freq_mHz);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span><span class="keywordtype">float</span> <a class="code hl_function" href="bsp__dwt_8h.html#af3972f1a5023286afdabf8e79abc5ed7">DWT_GetDeltaT</a>(uint32_t *cnt_last);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span><span class="keywordtype">double</span> <a class="code hl_function" href="bsp__dwt_8h.html#ae3519a5f8a00524b8ced263a18fbc37e">DWT_GetDeltaT64</a>(uint32_t *cnt_last);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span><span class="keywordtype">float</span> <a class="code hl_function" href="bsp__dwt_8h.html#ab100be84fd91e5f606bd34b2cd62ecef">DWT_GetTimeline_s</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span><span class="keywordtype">float</span> <a class="code hl_function" href="bsp__dwt_8h.html#aff20f0eb6b9b6e4df5c8e509b0ca06dd">DWT_GetTimeline_ms</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>uint64_t <a class="code hl_function" href="bsp__dwt_8h.html#abf89a827c23ac1dcbb5639369d658081">DWT_GetTimeline_us</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span><span class="keywordtype">void</span> <a class="code hl_function" href="bsp__dwt_8h.html#a88912548ae8934bfc08e9c340974cab9">DWT_Delay</a>(<span class="keywordtype">float</span> Delay);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span><span class="keywordtype">void</span> <a class="code hl_function" href="bsp__dwt_8h.html#a0f591d032752c63e190dc3d55ea959c7">DWT_SysTimeUpdate</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span><span class="preprocessor">#endif </span><span class="comment">/* BSP_DWT_H_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="absp__dwt_8h_html_a0f591d032752c63e190dc3d55ea959c7"><div class="ttname"><a href="bsp__dwt_8h.html#a0f591d032752c63e190dc3d55ea959c7">DWT_SysTimeUpdate</a></div><div class="ttdeci">void DWT_SysTimeUpdate(void)</div><div class="ttdoc">DWT更新时间轴函数,会被三个timeline函数调用</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:84</div></div>
<div class="ttc" id="absp__dwt_8h_html_a80bda377ca5cef73b03e7211b1fa18b9"><div class="ttname"><a href="bsp__dwt_8h.html#a80bda377ca5cef73b03e7211b1fa18b9">DWT_Init</a></div><div class="ttdeci">void DWT_Init(uint32_t CPU_Freq_mHz)</div><div class="ttdoc">初始化DWT,传入参数为CPU频率,单位MHz</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:43</div></div>
<div class="ttc" id="absp__dwt_8h_html_a88912548ae8934bfc08e9c340974cab9"><div class="ttname"><a href="bsp__dwt_8h.html#a88912548ae8934bfc08e9c340974cab9">DWT_Delay</a></div><div class="ttdeci">void DWT_Delay(float Delay)</div><div class="ttdoc">DWT延时函数,单位为秒/s.</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:127</div></div>
<div class="ttc" id="absp__dwt_8h_html_ab100be84fd91e5f606bd34b2cd62ecef"><div class="ttname"><a href="bsp__dwt_8h.html#ab100be84fd91e5f606bd34b2cd62ecef">DWT_GetTimeline_s</a></div><div class="ttdeci">float DWT_GetTimeline_s(void)</div><div class="ttdoc">获取当前时间,单位为秒/s,即初始化后的时间</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:100</div></div>
<div class="ttc" id="absp__dwt_8h_html_abf89a827c23ac1dcbb5639369d658081"><div class="ttname"><a href="bsp__dwt_8h.html#abf89a827c23ac1dcbb5639369d658081">DWT_GetTimeline_us</a></div><div class="ttdeci">uint64_t DWT_GetTimeline_us(void)</div><div class="ttdoc">获取当前时间,单位为微秒/us,即初始化后的时间</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:118</div></div>
<div class="ttc" id="absp__dwt_8h_html_ae3519a5f8a00524b8ced263a18fbc37e"><div class="ttname"><a href="bsp__dwt_8h.html#ae3519a5f8a00524b8ced263a18fbc37e">DWT_GetDeltaT64</a></div><div class="ttdeci">double DWT_GetDeltaT64(uint32_t *cnt_last)</div><div class="ttdoc">获取两次调用之间的时间间隔,单位为秒/s,高精度</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:73</div></div>
<div class="ttc" id="absp__dwt_8h_html_af3972f1a5023286afdabf8e79abc5ed7"><div class="ttname"><a href="bsp__dwt_8h.html#af3972f1a5023286afdabf8e79abc5ed7">DWT_GetDeltaT</a></div><div class="ttdeci">float DWT_GetDeltaT(uint32_t *cnt_last)</div><div class="ttdoc">获取两次调用之间的时间间隔,单位为秒/s</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:62</div></div>
<div class="ttc" id="absp__dwt_8h_html_aff20f0eb6b9b6e4df5c8e509b0ca06dd"><div class="ttname"><a href="bsp__dwt_8h.html#aff20f0eb6b9b6e4df5c8e509b0ca06dd">DWT_GetTimeline_ms</a></div><div class="ttdeci">float DWT_GetTimeline_ms(void)</div><div class="ttdoc">获取当前时间,单位为毫秒/ms,即初始化后的时间</div><div class="ttdef"><b>Definition</b> bsp_dwt.c:109</div></div>
<div class="ttc" id="amain_8h_html"><div class="ttname"><a href="main_8h.html">main.h</a></div><div class="ttdoc">: Header for main.c file. This file contains the common defines of the application.</div></div>
<div class="ttc" id="astruct_d_w_t___time__t_html"><div class="ttname"><a href="struct_d_w_t___time__t.html">DWT_Time_t</a></div><div class="ttdef"><b>Definition</b> bsp_dwt.h:22</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a href="dir_3c5459f7c179b79c90e2565474bb2856.html">bsp</a></li><li class="navelem"><a href="dir_fea582d6a6afdf428a0401dd23e754f9.html">dwt</a></li><li class="navelem"><a href="bsp__dwt_8h.html">bsp_dwt.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>
